package com.cn.jiyun.contoller;

import com.cn.jiyun.service.OrderService;
import com.cn.jiyun.entity.pojo.Order;
import com.jiyun.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;
    @RequestMapping("/findAll")
    public Result<List<Order>> findAll(){
        return Result.ok(orderService.findAll());
    }
    @RequestMapping("/findById")
    public Result<Order> findById(@RequestParam Integer id){
        return  Result.ok(orderService.findById(id));
    }

}
